package cn.edu.imut.bean;

import java.time.LocalDateTime;

public class CartBean {
    /*| 字段名          | 数据类型        | 说明                     |
|-----------------|-----------------|--------------------------|
| user_id         | INT            | 外键，关联用户表（user_id） |
| product_id      | INT            | 外键，关联商品表（product_id） |
| product_quantity| INT            | 商品数量                 |
| product_name    | VARCHAR(100)   | 商品名称（冗余字段，加速查询） |
| product_category| INT            | 商品分类ID（冗余字段）   |
| total_price     | DECIMAL(10, 2) | 商品小计金额             |
| added_time      | DATETIME       | 加入购物车的时间         |

     */
    private int user_Id;
    private int product_Id;
    private int product_quantity;
    private String product_name;
    private int product_category;
    private Double total_price;
    private LocalDateTime addedTime;

    public CartBean(int user_Id, int product_Id, int product_quantity, String product_name, int product_category, Double total_price, LocalDateTime addedTime) {
        this.user_Id = user_Id;
        this.product_Id = product_Id;
        this.product_quantity = product_quantity;
        this.product_name = product_name;
        this.product_category = product_category;
        this.total_price = total_price;
        this.addedTime = addedTime;
    }

    public CartBean() {
    }

    public int getUser_Id() {
        return user_Id;
    }

    public void setUser_Id(int user_Id) {
        this.user_Id = user_Id;
    }

    public int getProduct_Id() {
        return product_Id;
    }

    public void setProduct_Id(int product_Id) {
        this.product_Id = product_Id;
    }

    public int getProduct_quantity() {
        return product_quantity;
    }

    public void setProduct_quantity(int product_quantity) {
        this.product_quantity = product_quantity;
    }

    public String getProduct_name() {
        return product_name;
    }

    public void setProduct_name(String product_name) {
        this.product_name = product_name;
    }

    public int getProduct_category() {
        return product_category;
    }

    public void setProduct_category(int product_category) {
        this.product_category = product_category;
    }

    public Double getTotal_price() {
        return total_price;
    }

    public void setTotal_price(Double total_price) {
        this.total_price = total_price;
    }

    public LocalDateTime getAddedTime() {
        return addedTime;
    }

    public void setAddedTime(LocalDateTime addedTime) {
        this.addedTime = addedTime;
    }

    @Override
    public String toString() {
        return "CartBean{" +
                "user_Id=" + user_Id +
                ", product_Id=" + product_Id +
                ", product_quantity=" + product_quantity +
                ", product_name='" + product_name + '\'' +
                ", product_category=" + product_category +
                ", total_price=" + total_price +
                ", addedTime=" + addedTime +
                '}';
    }
}

